/*  File Name	: TimerTest.h
 *  Author		: Pang Jiacai
 *	 E-mail		: 823960168@qq.com
 *  Created on	: 2012-6-27
 *  Description:
 */

#ifndef TIMERTEST_H_
#define TIMERTEST_H_

#include <list>
#include <iostream>
#include "SvcHandler.h"
#include "Reactor.h"
#include "Timer.h"
#include "Task.h"
#include "Thread.h"

class TimerTask:public EventHandler,public Thread
{
public:
	TimerTask();
	virtual ~TimerTask();

	int timer_test(Reactor *reactor,int number);

	virtual int open(void);

	static int cb(void *p);

private:
	void add_timer();

	int run_loop(void);

	int timer_num_;

	std::list<Timer> timer_list;
};

#endif /* TIMERTEST_H_ */
